//
//  BOrderMallRootMenuCell.m
//  DistributorAB
//
//  Created by LZY on 2019/9/29.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "BOrderMallRootMenuCell.h"

@interface BOrderMallRootMenuCell ()
@property (nonatomic, strong) UIImageView *ivBg;//背景图片
@end

@implementation BOrderMallRootMenuCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupViewAction];
    }
    return self;
}
#pragma mark - 界面布局方法
- (void)setupViewAction{
    _ivBg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    [self.contentView addSubview:_ivBg];
}
#pragma mark - 界面更新
- (void)setCellIndexPathRow:(NSInteger)cellIndexPathRow{
    _cellIndexPathRow = cellIndexPathRow;
    NSString *level = [USER_DEFAULT objectForKey:@"level"];
    //省级经销商
    if ([level integerValue] == 1) {
        
        switch (cellIndexPathRow) {
            case 0:
            {
                //预订
                _ivBg.image = imgname(@"lijiyuding");
            }
                break;
            case 1:
            {
                //预订目录
                _ivBg.image = imgname(@"houbaoyudingdan");
            }
                break;
            case 2:
            {
                //补助金申请列表
                _ivBg.image = imgname(@"order_mall_apply_list_icon");
            }
                break;
            case 3:
            {
               
                //省级-市县级预订管理
                _ivBg.image = imgname(@"shixianjiyudingguanli");
                
            }
                break;
                
            default:
                break;
        }
    }
    //市县级经销商
   else if ([level integerValue] == 2) {
        
        switch (cellIndexPathRow) {
            case 0:
            {
                //扫码
                _ivBg.image = imgname(@"order_mall_code_icon");
            }
                break;
            case 1:
            {
                //预订
                _ivBg.image = imgname(@"lijiyuding");
            }
                break;
            case 2:
            {
                //侯保预订单
                _ivBg.image = imgname(@"houbaoyudingdan");
            }
                break;
            case 3:
            {
                //补助金申请列表
                _ivBg.image = imgname(@"order_mall_apply_list_icon");
                
            }
                break;
            case 4:
            {
              
                    //市县级-候保师傅预订管理
                    _ivBg.image = imgname(@"yudingguanli");
                
            }
                break;
                
            default:
                break;
        }
        
    }
    
    
}

@end
